package cc.rengu.igas.smps.common.utils;

import cc.rengu.igas.smps.common.enums.RespCodeEnum;
import cc.rengu.oltp.service.common.constant.AppParamConstant;
import cc.rengu.oltp.service.common.entity.SysParam;
import cc.rengu.oltp.service.model.BizException;
import cc.rengu.oltp.service.realize.SysParamService;
import cc.rengu.oltp.service.realize.impl.SysParamServiceImpl;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
import java.net.MalformedURLException;
import java.net.URL;

/**
 * This class was generated by Apache CXF 3.3.6
 * 2020-04-12T18:15:13.288+08:00
 * Generated source version: 3.3.6
 */
@WebServiceClient(name = "IPcQueryReportService",
        wsdlLocation = "${WSDLURL}",
        targetNamespace = "http://pcquery.bank.webservice.cissp.distribute.cfcc.com")
public class IPcQueryReportService extends Service {
    public static String WSDLURL;
    public final static URL WSDL_LOCATION;

    public final static QName SERVICE = new QName("http://pcquery.bank.webservice.cissp.distribute.cfcc.com", "IPcQueryReportService");
    public final static QName PcQueryReportServerImplPort = new QName("http://pcquery.bank.webservice.cissp.distribute.cfcc.com", "PcQueryReportServerImplPort");

    static {
        URL url = null;
        try {
            SysParamService sysParamService = new SysParamServiceImpl();
            SysParam sysParam = sysParamService.getSysParamInfo(AppParamConstant.DEFAULT_INSTID, "SMPS_PCIS_PARAM", "WSDL_LOCATION");
            if (null == sysParam) {
                throw new BizException(RespCodeEnum.KET_PARAM_EMPTY_OR_NULL.getRespCode(), RespCodeEnum.KET_PARAM_EMPTY_OR_NULL.getRespCode());
            }
            WSDLURL = sysParam.getParamValue();
            url = new URL(WSDLURL);
        } catch (MalformedURLException e) {
            java.util.logging.Logger.getLogger(IPcQueryReportService.class.getName())
                    .log(java.util.logging.Level.INFO,
                            "Can not initialize the default wsdl from {0}", "http://36.33.192.18:9099/cissp-core-server/services/IPcQueryReportService?wsdl");
        } catch (Exception e) {

        }
        WSDL_LOCATION = url;
    }

    public IPcQueryReportService(URL wsdlLocation) {
        super(wsdlLocation, SERVICE);
    }

    public IPcQueryReportService(URL wsdlLocation, QName serviceName) {
        super(wsdlLocation, serviceName);
    }

    public IPcQueryReportService() {
        super(WSDL_LOCATION, SERVICE);
    }

    public IPcQueryReportService(WebServiceFeature... features) {
        super(WSDL_LOCATION, SERVICE, features);
    }

    public IPcQueryReportService(URL wsdlLocation, WebServiceFeature... features) {
        super(wsdlLocation, SERVICE, features);
    }

    public IPcQueryReportService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
        super(wsdlLocation, serviceName, features);
    }


    /**
     * @return returns IPcQueryReportServer
     */
    @WebEndpoint(name = "PcQueryReportServerImplPort")
    public IPcQueryReportServer getPcQueryReportServerImplPort() {
        return super.getPort(PcQueryReportServerImplPort, IPcQueryReportServer.class);
    }

    /**
     * @param features A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
     * @return returns IPcQueryReportServer
     */
    @WebEndpoint(name = "PcQueryReportServerImplPort")
    public IPcQueryReportServer getPcQueryReportServerImplPort(WebServiceFeature... features) {
        return super.getPort(PcQueryReportServerImplPort, IPcQueryReportServer.class, features);
    }

}
